create or replace view vac_application_authoriz_4_1 as
with author AS
(
select
 workspace,
 workspace_display_name,
 application_id,
 application_name,
 authorization_scheme_name,
 scheme_type,
 scheme_type_code,
 attribute_01,
 attribute_02,
 attribute_03,
 attribute_04,
 attribute_05,
 attribute_06,
 attribute_07,
 attribute_08,
 attribute_09,
 attribute_10,
 attribute_11,
 attribute_12,
 attribute_13,
 attribute_14,
 attribute_15,
 error_message,
 caching,
 is_subscribed,
 last_updated_by,
 last_updated_on,
 component_comment,
 authorization_scheme_id,
 referenced_scheme_id,
 component_signature
from APEX_APPLICATION_AUTHORIZATION t
)
select
 workspace,
 workspace_display_name,
 application_id,
 application_name,
 authorization_scheme_name,
 authorization_scheme_id,
 referenced_scheme_id,
 last_updated_by,
 last_updated_on,
 'APEX_APPLICATION_AUTHORIZATION' src_view_name,
 u_name,
 u_value
from author
 UNPIVOT INCLUDE NULLS
  (u_value FOR u_name IN
     ( scheme_type,
       scheme_type_code,
       attribute_01,
       attribute_02,
       attribute_03,
       attribute_04,
       attribute_05,
       attribute_06,
       attribute_07,
       attribute_08,
       attribute_09,
       attribute_10,
       attribute_11,
       attribute_12,
       attribute_13,
       attribute_14,
       attribute_15,
       error_message,
       caching,
       is_subscribed,
       component_comment
     )
  );

